﻿using System;
using Infrastructure.NetExtensions;

namespace TempEmployees.Web
{
    public abstract class ABasePage : System.Web.UI.Page
    {
        protected SessionState State
        {
            get
            {
                return Session.Get<SessionState>(SessionState.SESSION_STATE);
            }
            set
            {
                Session.Set<SessionState>(SessionState.SESSION_STATE, value);
            }
        }

        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (State == null) throw new NoSessionStateException(GUIServices.PAGE_SEARCH_ASSIGNMENTS);
        }
    }
}
